home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 January - Disc 2 / Macworld (1999-01) (Disk 2).dmg / Serious Demos / Symbolic Composer 4.2 / Environment / Projects / Questions & Answers / Q&A Programming Music / Minimum number of samples < prev    next >
Text File  |  1998-10-26  |  4KB  |  71 lines

  1. DETERMINING MINIMUM NUMBER OF SAMPLES
  2.  
  3. >    My question is this:  is there a way to determine the minimum number of
  4. >samples needed to accurately represent a given vector?  A method that will
  5. >work with complex algorithms such as the output of Vector-Mix and
  6. >Vector-Amplify as well as with simple ones such as Gen-sin?
  7.  
  8. I would say that it depends on the purpose. If the material is a cyclic
  9. wave-like data then you should select the number of samples so that you
  10. will be recognizing the form. Minimizing the number of sample points
  11. while maximizing perceptional distinction is the main rule. Often 8-16
  12. elements can describe a melodic wave in 1/16 rhythm and if there are more
  13. then the material will sound too redundant. Ear is sensitive in catching
  14. the meaning from tiny patterns. And then it likes that these patterns
  15. are organized in a second level. I have made interesting melodies starting
  16. from a couple of 4 element length waves which are then inverted and
  17. retrograded and then appended into a 16 element wave, which is then
  18. used as a pattern and itself inverted and retrograded. Controller
  19. data should be sent 1/32 to sound smooth and hundreds of sample points
  20. are needed to represent wavy data.
  21.  
  22.     The waveform freqency to smaple ratio issues is a larger problem than one
  23. may think.  For instance, here is the most basic example I can give:  In
  24. the visualizer, graph the following:
  25.  
  26.     (gen-sin 16 1 64 0)    ;and then graph
  27.     (gen-sin 16 1 63 0)      ; as you can see, the waveform does not represent
  28. the algorithm which was used to generate it...  The problem worsens
  29. however...  
  30.     (gen-sin 16 1 65 0)    ;  one would think, under the assumption that this
  31. is somethin akin to ailiasing, that once the samples were safely above a
  32. given number that distortion would be eliminated.  As shown, this is not
  33. the case.  In fact graph these:
  34.  
  35.     (gen-sin 16 1 127 0)
  36.     (gen-sin 16 1 128 0)
  37.     (gen-sin 16 1 129 0)
  38.  
  39.     With simple waveforms it is possible though tedious to determine the right
  40. sample numbers and fit them into the larger score structure, but with more
  41. complex algorithms it is much more difficult.  This worries me in that what
  42. I think that I may be programming may not be exactly what is reproduced.
  43. Creating melodies is especially critical.  Randomness is nice, when that is
  44. what I want, but that is what gen-white noise or is for!  ;-)  Can you
  45. offer any further explanation of this or do you suggest I post the question
  46. to the discussion list?
  47.  
  48. >is somethin akin to ailiasing, that once the samples were safely above a
  49. >given number that distortion would be eliminated.  As shown, this is not
  50. >the case.  In fact graph these:
  51. >    (gen-sin 16 1 127 0)
  52. >    (gen-sin 16 1 128 0)
  53. >    (gen-sin 16 1 129 0)
  54.  
  55. >But, even 32 values of sin fool the ear to perceive a continuous
  56. >wave when applied to a filter sweep. It all depends on where you
  57. >draw the mark on the water.
  58.  
  59.     But I am NOT talking about "how many points must one use to accurately
  60. represent a given waveform to human perception?"  I AM talking about, "How
  61. many samples are needed, due to the structure of the program and
  62. mathematics behind it, to represent a given waveform without getting sample
  63. values that are not found on the waveform when an infinite number of
  64. samples are taken?"  What I am reporting, and it needs to be said that
  65. perhaps I am perceiving things incorrectly, is that if an "unfit" or
  66. "improper" number of samples are used, sampler points which are later
  67. converted to symbols or vector lists or whatever, are given which are not
  68. in accordance with the shape of the waveform;  they are in error!  They are
  69. not found on the continuous line of the waveform.  This is what is not
  70. acceptable;  this is what i am trying to guard against.
  71.